<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>js运算符</title>
</head>
<body>
	
</body>
<script>
	//隔行换色
	for(i=0;i<10;i++){
		if(i%2==0){
			document.write('<h2 style="background:#ccc;">'+i+'</h2>');
		}else{
			document.write('<h2 style="">'+i+'</h2>');
		}
	}
</script>
</html>